package logic.bean;

import java.io.Serializable;

import logic.beanenum.BookStatus_Enum;
import logic.constants.Const;

/**
 * 最近阅读
 * @author 刘宾  
 * @date 2014年11月11日 上午9:52:30
 */
public class ReadBook
        implements
        Serializable
{
    private static final long serialVersionUID = 7607540694513015180L;
	public long               id;//唯一id
	public long               bookId;//内容id
	public int                isOnline; // 0|1:离线|在线
	public String             bookName;//书名
	public String             author;//作者
	public int                contentType; //内容类型 1=书籍 2=杂志 3=连载 4=漫画 5=有声读物
	public String             logoURL;//封面url,分辨率适配客户端自己组成请求
	public long               chapterId;//章节Id
	public String             chapterName;//章节名称
	public long               createTime;//创建时间
	public String             account;      //用户帐号  
	public long               enterpriseId;//企业id
	public String             ncxUrl;      //目录下载url
	
	public BookBean toBookBean(){
		BookBean bean = new BookBean();
		bean.account = Const.phone_number;
		bean.book_id = bookId;
		bean.book_name = bookName;
		bean.author = author;
		bean.book_type = contentType;
		bean.create_time = String.valueOf(createTime);
		bean.isOnline = isOnline;
		bean.syncStatus = BookBean.SYNC;
		bean.logo_url = logoURL;
		bean.server_id = id;
		bean.server_chapterid = chapterId;
		bean.status = BookStatus_Enum.ONLINE.getValue();
		bean.ncxUrl = ncxUrl;
		bean.chapterName = chapterName;
		return bean;
	}
	
	@Override
    public String toString() {
	    return "ReadBook [id=" + id + ", bookId=" + bookId + ", isOnline=" + isOnline + ", bookName=" + bookName + ", contentType=" + contentType + ", logoURL=" + logoURL + ", chapterId=" + chapterId + ", chapterName=" + chapterName + ", createTime=" + createTime + ", account=" + account + ", enterpriseId=" + enterpriseId + "]";
    }
	
	
}
